//
//  YRJAllHotCityTableViewCell.m
//  YanRenjie
//
//  Created by dllo on 15/10/28.
//  Copyright (c) 2015年 yanrenjie. All rights reserved.
//

#import "YRJAllHotCityTableViewCell.h"

#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height
@implementation YRJAllHotCityTableViewCell
- (void)dealloc {
    [_photoImageView release];
    [_catenameLabel release];
    [_catename_enLabel release];
    [_beenstrLabel release];
    [_representativeLabel release];
    
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createCell];
    }
    return self;
}

- (void)createCell {
    self.photoImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.photoImageView];
    [_photoImageView release];
    
    self.catenameLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.catenameLabel];
    [_catenameLabel release];
    self.catenameLabel.font = [UIFont systemFontOfSize:12];
    
    self.catename_enLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.catename_enLabel];
    [_catename_enLabel release];
    self.catename_enLabel.font = [UIFont systemFontOfSize:12];
    
    self.beenstrLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.beenstrLabel];
    [_beenstrLabel release];
    self.beenstrLabel.font = [UIFont systemFontOfSize:12];
    
    self.representativeLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.representativeLabel];
    [_representativeLabel release];
    self.representativeLabel.font = [UIFont systemFontOfSize:14];
    self.representativeLabel.numberOfLines = 3;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.photoImageView.frame = CGRectMake(0, 0, (150.0 / 375.0) * WIDTH, (120.0 / 119.5) * HEIGHT);
    self.representativeLabel.frame = CGRectMake((155.0 / 375.0) * WIDTH, (5.0 / 119.5) * HEIGHT, (215.0 / 375.0) * WIDTH, (60.0 / 119.5) * HEIGHT);
    self.beenstrLabel.frame = CGRectMake((155.0 / 375.0) * WIDTH, (60.0 / 119.5) * HEIGHT, (215.0 / 375.0) * WIDTH, (25.0 / 119.5) * HEIGHT);
    self.catenameLabel.frame = CGRectMake((155.0 / 375.0) * WIDTH, (90.0 / 119.5) * HEIGHT, (100.0 / 375.0) * WIDTH, (20.0 / 119.5) * HEIGHT);
    self.catename_enLabel.frame = CGRectMake((270.0 / 375.0) * WIDTH, (90.0 / 119.5) * HEIGHT, (100.0 / 375.0) * WIDTH, (20.0 / 119.5) * HEIGHT);
    NSLog(@"%f", WIDTH);
    NSLog(@"%f", HEIGHT);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
